# -*- coding: utf-8 -*-
import maya.cmds as cmds
import maya.mel as mel

def Check_UnknownNode() :
    log = ''
    unknownNodeList = cmds.ls(type="unknown")
    if unknownNodeList:
        cmds.lockNode(unknownNodeList, l=0)
        cmds.delete(unknownNodeList)
    unknownNodeList = cmds.ls ( type="unknown" )
    if unknownNodeList :
        log += "unknown-NO,"
    else :
        log += "unknown-YES,"



    unknownDagList = cmds.ls(type="unknownDag")
    if unknownDagList:
        cmds.delete(unknownDagList)
    unknownDagList = cmds.ls ( type="unknownDag" )
    if unknownDagList :
        log += "unknownDag-NO,"
    else:
        log += "unknownDag-YES,"



    loaded_plugins = cmds.unknownPlugin(query=True, list=True)
    if loaded_plugins:
        for plugin in loaded_plugins:
            cmds.unknownPlugin(plugin, remove=True)
    loaded_plugins = cmds.unknownPlugin ( query=True, list=True )
    if loaded_plugins :
        log += "unknownPlugin-NO,"
    else:
        log += "unknownPlugin-YES,"
    return (log)